package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func init() {
	// set default database
	orm.RegisterDataBase("default", "mysql",
		"root:123456@tcp(192.168.88.137:3306)/DailyFresh?charset=utf8")

	// register model
	orm.RegisterModel(new(User), new(Address), new(OrderGoods), new(OrderInfo),
		new(IndexPromotionBanner), new(IndexTypeGoodsBanner), new(IndexGoodsBanner),
		new(GoodsImage), new(GoodsSKU), new(GoodsType), new(Goods))

	// create table
	orm.RunSyncdb("default", false, true)
}
